package com.telekom.ai4coding.openai.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Generated;
import jakarta.validation.constraints.NotNull;

import java.util.Objects;

/**
 * The function that the model called.
 */

@Schema(name = "ChatCompletionMessageToolCall_function", description = "The function that the model called.")
@JsonTypeName("ChatCompletionMessageToolCall_function")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class ChatCompletionMessageToolCallFunction {

  private String name;

  private String arguments;

  public ChatCompletionMessageToolCallFunction() {
    super();
  }

  /**
   * Constructor with only required parameters
   */
  public ChatCompletionMessageToolCallFunction(String name, String arguments) {
    this.name = name;
    this.arguments = arguments;
  }

  public ChatCompletionMessageToolCallFunction name(String name) {
    this.name = name;
    return this;
  }

  /**
   * The name of the function to call.
   * @return name
  */
  @NotNull 
  @Schema(name = "name", description = "The name of the function to call.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("name")
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public ChatCompletionMessageToolCallFunction arguments(String arguments) {
    this.arguments = arguments;
    return this;
  }

  /**
   * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
   * @return arguments
  */
  @NotNull 
  @Schema(name = "arguments", description = "The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.", requiredMode = Schema.RequiredMode.REQUIRED)
  @JsonProperty("arguments")
  public String getArguments() {
    return arguments;
  }

  public void setArguments(String arguments) {
    this.arguments = arguments;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ChatCompletionMessageToolCallFunction chatCompletionMessageToolCallFunction = (ChatCompletionMessageToolCallFunction) o;
    return Objects.equals(this.name, chatCompletionMessageToolCallFunction.name) &&
        Objects.equals(this.arguments, chatCompletionMessageToolCallFunction.arguments);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, arguments);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ChatCompletionMessageToolCallFunction {\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    arguments: ").append(toIndentedString(arguments)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}